package com.eling.elcms.travel.model;

import com.eling.elcms.basedoc.model.RoomType;
import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

@Entity
@Table(name = "travel_signuproomtypecount")
@Indexed
public class SignUpRoomTypeCount extends BaseModel{

	private static final long serialVersionUID = 6579759448358658590L;

	@Id
	@In
	@DocumentId
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkSignUpRoomTypeCount;
	
	/** 房型*/
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkRoomType")
	@IndexedEmbedded(depth = 1)
	private RoomType roomType;
	
	/** 数量*/
	@Column
	@Field
	private Integer roomCount;
	
	@Version
	private Integer version;

	public Long getPkSignUpRoomTypeCount() {
		return pkSignUpRoomTypeCount;
	}

	public void setPkSignUpRoomTypeCount(Long pkSignUpRoomTypeCount) {
		this.pkSignUpRoomTypeCount = pkSignUpRoomTypeCount;
	}

	public RoomType getRoomType() {
		return roomType;
	}

	public void setRoomType(RoomType roomType) {
		this.roomType = roomType;
	}

	public Integer getRoomCount() {
		return roomCount;
	}

	public void setRoomCount(Integer roomCount) {
		this.roomCount = roomCount;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}
}
